{% load staticfiles %}
{% load node_tag %}

<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="renderer" content="webkit">

    <title>
        {% block title %}{% endblock %}
    </title>
    <meta name="keywords" content="{% block keywords %}{% endblock %}">
    <meta name="description" content="{% block description %}{% endblock %}">

    <link href="{% static 'xadmin/css/bootstrap.min.css' %}" rel="stylesheet">
    <link href="{% static 'xadmin/font-awesome/css/font-awesome.css' %}" rel="stylesheet">
    <link href="{% static 'xadmin/css/plugins/iCheck/custom.css' %}" rel="stylesheet">
    <link href="{% static 'xadmin/css/animate.css' %}" rel="stylesheet">
    <link href="{% static 'xadmin/css/style.css' %}" rel="stylesheet">
    <link href="{% static 'xadmin/layui/css/layui.css' %}" rel="stylesheet">
    {% block css %}

    {% endblock %}

    {% block style %}
    
    {% endblock %}

</head>

<body>
    <div id="wrapper">
        <nav class="navbar-default navbar-static-side" role="navigation">
            <div class="sidebar-collapse">
                <ul class="nav" id="side-menu">
                    <li class="nav-header">

                        <div class="dropdown profile-element">
                            <span>
                                <img alt="image" class="img-circle" src="{{ MEDIA_URL }}{{ site.logo }}" style="width:64px;"/>
                            </span>
                            <a data-toggle="dropdown" class="dropdown-toggle" href="index.html#">
                                <span class="clear">
                                    <span class="block m-t-xs">
                                        <strong class="font-bold"></strong>
                                    </span>
                                    <span class="text-muted text-xs block">{{ site.name }}<b class="caret"></b></span>
                                </span>
                            </a>
                            <ul class="dropdown-menu animated fadeInRight m-t-xs">
                                {% for s in sites %}
                                    {% if s.id != site.id %}
                                        <li>
                                            <a href="{% url 'nodelist' %}?siteid={{ s.id }}">{{ s.name }}</a>
                                        </li>
                                    {% endif %}
                                {% endfor %}
                            </ul>
                        </div>
                        <div class="logo-element">

                        </div>

                    </li>
                    <li class="leftmenu {% isActive mbx '栏目管理' %}">
                        <a href="#">
                        	<i class="fa fa-th-large"></i>
                        	<span class="nav-label">栏目管理</span>
                            <span class="fa arrow"></span>
                        </a>
                        <ul class="nav nav-second-level">
                            <li class="{% isActive mbx '栏目' %}">
                                <a href="/admin/node/list/?siteid={{ siteid }}">栏目</a>
                            </li>
                            <li class="{% isActive mbx '栏目组管理' %}">
                                <a href="{% url 'nodegrouplist' %}?siteid={{ siteid }}">栏目组</a>
                            </li>
                        </ul>

                    </li>

                    <li class="leftmenu {% isActive mbx '内容管理' %}">
                        <a href="index.html#" class="lefta">
                        	<i class="fa fa fa-globe"></i>
                        	<span class="nav-label">内容管理</span>
                        	<span class="fa arrow"></span>
                        </a>
                        <ul class="nav nav-second-level">
                            <li class="{% isActive mbx '文章' %}">
                            	<a href="{% url 'articlelist' %}?siteid={{ siteid }}" class="leftb">文章</a>
                            </li>
                            <li class="{% isActive mbx '文章组' %}">
                            	<a href="{% url 'articlegrouplist' %}?siteid={{ siteid }}" class="leftb">文章组</a>
                            </li>
                            <li class="{% isActive mbx '审核' %}">
                            	<a href="#" class="leftb">审核</a>
                            </li>
                        </ul>
                    </li>
                    <li class="leftmenu {% isActive mbx '模版管理' %}">
                        <a href="/admin/template/list/?siteid={{ siteid }}" class="lefta">
                        	<i class="fa fa-flask"></i>
                        	<span class="nav-label">模版管理</span>
                        </a>
                    </li>
                    <li class="leftmenu {% isActive mbx '广告管理' %}">
                        <a href="#" class="lefta">
                        	<i class="fa fa-flask"></i>
                        	<span class="nav-label">广告管理</span>
                        </a>
                    </li>
                    <li class="leftmenu {% isActive mbx '部件管理' %}">
                        <a href="{% url 'partlist' %}?siteid={{ siteid }}" class="lefta">
                        	<i class="fa fa-flask"></i>
                        	<span class="nav-label">部件管理</span>
                        </a>
                    </li>
                    <li class="leftmenu {% isActive mbx '站点管理' %}">
                        <a href="{% url 'sitelist' %}?siteid={{ siteid }}" class="lefta">
                        	<i class="fa fa-flask"></i>
                        	<span class="nav-label">站点管理</span>
                        </a>
                    </li>
                    <li class="leftmenu {% isActive mbx '系统配置' %}">
                        <a href="index.html#" class="lefta">
                        	<i class="fa fa fa-globe"></i>
                        	<span class="nav-label">系统配置</span>
                        	<span class="fa arrow"></span>
                        </a>
                        <ul class="nav nav-second-level">
                            <li class="{% isActive mbx '用户' %}">
                            	<a href="{% url 'userlist' %}?siteid={{ siteid }}" class="leftb">用户</a>
                            </li>
                            <li class="{% isActive mbx '角色' %}">
                            	<a href="{% url 'grouplist' %}?siteid={{ siteid }}" class="leftb">角色</a>
                            </li>
                        </ul>
                    </li>
                    {% if request.user.is_superuser %}
                        <li class="leftmenu {% isActive mbx '管理员日志' %}">
                            <a href="{% url 'auditlist' %}?siteid={{ siteid }}" class="lefta">
                                <i class="fa fa-flask"></i>
                                <span class="nav-label">管理员日志</span>
                            </a>
                        </li>
                    {% else %}
                        {% for perm_type, perm_slug_list in perm_dic.items %}
                            {% if perm_type == 'audit' %}
                                {% if 'show' in perm_slug_list %}
                                    <li class="leftmenu {% isActive mbx '管理员日志' %}">
                                        <a href="{% url 'auditlist' %}?siteid={{ siteid }}" class="lefta">
                                            <i class="fa fa-flask"></i>
                                            <span class="nav-label">管理员日志</span>
                                        </a>
                                    </li>
                                {% endif %}
                            {% endif %}
                        {% endfor %}

                    {% endif %}

                </ul>

            </div>
        </nav>

        <div id="page-wrapper" class="gray-bg dashbard-1">
            <div class="row border-bottom">
                <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
                    <div class="navbar-header">
                        <a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="javascript:;"><i class="fa fa-bars"></i> </a>
                        <form role="search" class="navbar-form-custom" method="post">
                            <div class="form-group">
{#                                <input type="text" placeholder="请输入您需要查找的内容 …" class="form-control" name="top-search" id="top-search">#}
                            </div>
                        </form>
                    </div>
                    <ul class="nav navbar-top-links navbar-right">
                        <li>
                            <a href="{% url 'staticindex' %}?siteid={{ siteid }}">
                                <i class="fa fa-user"></i> 开发者
                            </a>
                        </li>
                        <li>
                            <span class="m-r-sm text-muted welcome-message">
                            	<a href="" title="返回首页">
                            		<i class="fa fa-home"></i>
                            	</a>
                            	欢迎使用WEBPLUG CMS
                            </span>
                        </li>
                        <li>
                            <a href="#">
                                <i class="fa fa-user"></i> {{ request.user.chinese_name }}
                            </a>
                        </li>
                        <li>
                            <a href="#" onclick="setpassword()">
                                <i class="fa fa-cog"></i> 修改密码
                            </a>
                        </li>
                        <li>
                            <a href="{% url 'dologout' %}">
                                <i class="fa fa-sign-out"></i> 退出
                            </a>
                        </li>
                    </ul>

                </nav>
            </div>
            <div class="row wrapper border-bottom white-bg" style="height:40px;">
                <div style="height:40px;line-height: 40px;">
                    <ol class="breadcrumb">
                        {% for m in mbx %}
                            {% if forloop.last %}
                                <li>
                                    <strong>{{ m }}</strong>
                                </li>
                            {% else %}
                                <li>
                                    <a href="#">{{ m }}</a>
                                </li>
                            {% endif %}
                        {% endfor %}
                    </ol>
                </div>
            </div>
            <div class="wrapper wrapper-content animated">
                	<!-- 内容区在此 -->
                <div class="row">
                    <div class="col-lg-12">
                        <div class="ibox float-e-margins">
                            <div class="ibox-content">
                                <div class="row">
                                   {% block main %}

                                   {% endblock %}
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="footer">
                <div class="pull-right">
                    By：<a href="http://www.imotation.com" target="_blank">北京因脉科技有限公司</a>
                </div>
                <div>
                    <strong>Copyright</strong> INMO &copy; 2019
                </div>
            </div>

        </div>
    </div>


    </div>

    <!-- Mainly scripts -->
    <script src="{% static 'xadmin/js/jquery-2.1.1.min.js' %}"></script>
    <script src="{% static 'xadmin/js/bootstrap.min.js' %}"></script>
    <script src="{% static 'xadmin/js/plugins/metisMenu/jquery.metisMenu.js' %}"></script>
    <script src="{% static 'xadmin/js/plugins/slimscroll/jquery.slimscroll.min.js' %}"></script>

    <!-- Peity -->
    <script src="{% static 'xadmin/js/plugins/peity/jquery.peity.min.js' %}"></script>

    <!-- Custom and plugin javascript -->
    <script src="{% static 'xadmin/js/hplus.js' %}"></script>
    <script src="{% static 'xadmin/js/plugins/pace/pace.min.js' %}"></script>

    <!-- iCheck -->
    <script src="{% static 'xadmin/js/plugins/iCheck/icheck.min.js' %}"></script>

    <!-- Peity -->
    <script src="{% static 'xadmin/js/demo/peity-demo.js' %}"></script>
    <script src="{% static 'xadmin/layui/layui.all.js' %}"></script>


    <script>
        function setpassword(){
            layer.open({
                type: 2,
                offset: 'auto',
                area: ['400px', '300px'],
                anim: 0,
                closeBtn: 2,
                title: '修改密码',
                content: '{% url "setpassword" request.user.id %}',
                shade: 0.4,
            })
        }
    </script>

    {% block script %}

    {% endblock %}



</body>

</html>
